﻿function AzureOnlineBlobContainerPropertiesView(context) {

    var self = this;
    
    var dispatcher = $({});
    
    var container = ko.observable(null);

    function init(containerModel) {
        container(containerModel);
    }

    function validate() {
        return true;
    }

    function submit() {
        var api = context.api();
        if (validate()) {
            dispatcher.trigger('success');
        }
    }
    
    function toHex(val) {
        if (utils.isNullOrWhiteSpace(val)) return '';
        var b64 = new Base64().decode(val);
        return new HexString().format(b64);
    }

    self.container = container;
    self.init = init;
    self.submit = submit;

    self.toHex = toHex;
    
    self.addOnSuccess = function (handler) {
        dispatcher.bind('success', handler);
    };
}